Repository navigation
fix: pass file filters to the wiki structure step by keyword - #628
Merged
sng-asyncfunc merged 1 commit intoNov 10, 2026
Merged
Conversation
_determine_structure passed the filters to read_repo_file_tree in (excluded_dirs, excluded_files, included_dirs, included_files) order, but the function takes (included_files, included_dirs, excluded_files, excluded_dirs). The file tree sent to the LLM for the wiki structure applied exclusions as inclusions and the other way around. Pass them by keyword.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
_determine_structurepasses the file filters toread_repo_file_treeby position, in the orderexcluded_dirs, excluded_files, included_dirs, included_files:The function takes them in a different order:
So the file tree sent to the LLM for the wiki structure swaps each exclusion with an inclusion. For example,
excluded_dirs=["node_modules"]arrives asincluded_files=["node_modules"]. That switchesiterate_filesinto inclusion mode, and the structure prompt ends up with an empty or wrong file tree. Withincluded_dirs=["src"], the value lands inexcluded_filesand nothing is restricted.Indexing and page generation are not affected.
prepare_repo_indexandChatCompletionRequestalready pass the filters by keyword, so only the structure step disagrees with them.Fix
api/services/wiki/tasks.py: pass the four filters by keyword.Tests
Added
test_determine_structure_passes_file_filterstotests/backend/services/test_wiki_task.py. It runs_determine_structurewith a stubbedRepo, file tree reader andresearch_chat, and checks that each filter reachesread_repo_file_treeunder its own name.main: 1 failed (the filters arrive by position)pytest tests/test_config.py tests/backend: 64 passedruff checkreports the same 3 pre-existing issues in these two files as onmain, and nothing on the changed lines.